<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2018/3/23
  Time: 12:17
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" isELIgnored="false" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="f" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <title>个人公司（在职）主页</title>
    <link type="text/css" rel="stylesheet" href="../css/homePage.css"/>
    <link type="text/css" rel="stylesheet" href="../css/sectionList.css"/>
    <script type="text/javascript" src="../script/jquery-3.2.1.js"></script>
    <script type="text/javascript" src="../script/sectionList.js"></script>
    <script type="text/javascript" src="../script/commonFunction.js"></script>
    <script type="text/javascript" src="../script/onJobPage.js"></script>
    <style type="text/css">
        #welcome, #menu_div, #main_div {
            /*border: solid 1px #000;*/
        }

        #menu_div_ul h4 {
            margin-top: -50px;
        }

        #menu_div_ul h4:nth-child(even) {
            left: 70px;
        }

        #menu_div_ul h4:first-child {
            margin-top: 20px;
        }

        .main_sign {
            float: right;
            margin-right: 30px;
            color: #000;
            width: 100px;
            height: 50px;
            line-height: 50px;
            font-size: 18px;
            text-align: center;
            position: relative;
            right: 2%;
            z-index: 1000;
        }

        #showTime {
            float: right;
            margin-right: 50%;
        }
    </style>
    <script type="text/javascript">
        $(function () {
            $("#main_div").children().hide();

            tick();

            checkSignIn();

            $("#user_look_detail").click(function () {
                switchoverColor(this, $("#user_detail"));
            });

            $("#user_look_attendance").click(function () {
                selectYMD($("#a_year"), $("#a_month"), $("#a_day"));
                findUserAttendances();
                switchoverColor(this, $("#user_attendance"));
            });

            $("#user_a_go_back").click(function () {
                goBack($("#user_attendance"),$("#user_look_attendance"));
//                $("#user_attendance").hide();
//                $("#user_look_attendance").css("background-color", "rgba(0, 150, 255, 0.8)").parent().css("color", "#fff");
            });

            $("#user_update_psw").click(function () {
                switchoverColor(this, $("#update_psw"));
            });

            $("#user_look_position").click(function () {
                switchoverColor(this, $("#user_position"));
            });

            $("#user_look_rp").click(function () {
                selectYMD($("#rp_year"), $("#rp_month"));
                findUserRP();
                switchoverColor(this, $("#user_rp"));
            });

            $("#user_rp_go_back").click(function () {
                goBack($("#user_rp"),$("#user_look_rp"));
//                $("#user_rp").hide();
//                $("#user_look_rp").css("background-color", "rgba(0, 150, 255, 0.8)").parent().css("color", "#fff");
            });

            $("#user_look_salary").click(function () {
                selectYMD($("#salary_year"), $("#salary_month"));
                switchoverColor(this, $("#user_salary"));
//                $("#user_dissent_background").show();
//                $("#user_dissent").show();
            });

            $("#user_salary_go_back").click(function () {
                goBack($("#user_salary"),$("#user_look_salary"));
//                $("#user_salary").hide();
//                $("#user_look_salary").css("background-color", "rgba(0, 150, 255, 0.8)").parent().css("color", "#fff");
            });

            $("#user_other").click(function () {
                lastDissent();
                switchoverColor(this, $("#user_others"));
            });

            $("#user_dissent_go_back").click(function () {
                goBack($("#user_others"),$("#user_other"));
            });
        });

    </script>
</head>

<body id="main_body">
<div id="welcome">
    <c:if test="${user != null}">
        欢迎${user.phone }登录&nbsp;&nbsp;&nbsp;<a onclick="quit()">退出</a>
    </c:if>
    <%--欢迎登录--%>
    <c:if test="${user == null }">
        <%response.sendRedirect("../user/login.jsp");%>
    </c:if>
    <span id="showTime">本地时间：<span id="localtime"></span></span>
</div>

<input type="hidden" name="userId" id="on_job_page_user_id" value="${user.id}">
<input type="hidden" name="resumeId" id="on_job_page_resume_id" value="${resume.id}">
<input type="button" id="main_sign_out" class="main_sign" value="下班签退" onclick="userSignOut()"/>
<input type="button" id="main_sign_in" class="main_sign" value="上班签到" onclick="userSignIn()"/>

<div id="menu_div">
    <ul id="menu_div_ul">
        <h4>
            <li id="user_look_detail">个人信息</li>
        </h4>
        <h4>
            <li id="user_look_attendance">我的考勤</li>
        </h4>
        <h4>
            <li id="user_update_psw">修改密码</li>
        </h4>
        <h4>
            <li id="user_look_rp">我的奖惩</li>
        </h4>
        <h4>
            <li id="user_look_position">部门职位</li>
        </h4>
        <h4>
            <li id="user_look_salary">我的薪资</li>
        </h4>
        <h4>
            <li id="user_other">其他</li>
        </h4>
        <h4>
            <li id="quit">退出</li>
        </h4>
    </ul>
</div>
<div id="main_div">

    <div id="user_detail">
        <jsp:include page="resume.jsp"/>
    </div>

    <div id="user_attendance">
        <div id="attendance_div0" style="margin: 30px 25%;">
            <select id="a_year"></select>
            <select id="a_month"></select>
            <select id="a_day">
                <option value="">日期</option>
            </select>
            <input type="button" value="查询" onclick="findUserAttendances()">
            <span>该月目前出勤<span id="user_in_job"></span> 天</span>
            <table cellspacing="0" cellpadding="0" border="1" style="background-color: rgba(0,130,230,0.6);"
                   id="user_attendance_table">
                <thead>
                <tr>
                    <th colspan="5">我的考勤</th>
                </tr>
                <tr>
                    <th style="width: 160px">上班时间</th>
                    <th style="width: 160px">下班时间</th>
                    <th style="width: 100px">迟到</th>
                    <th style="width: 100px">早退</th>
                    <th style="width: 100px">加班</th>
                </tr>
                </thead>
                <tbody>
                </tbody>
                <tfoot>
                <tr>
                    <td colspan="6" style="text-align: center;">
                        <input type="button" value="返回" id="user_a_go_back">
                    </td>
                </tr>
                </tfoot>
            </table>
        </div>
    </div>

    <div id="update_psw">
        <jsp:include page="updatePsw.jsp"/>
    </div>

    <div id="user_rp">
        <div id="rp_div0" style="margin: 30px 30%;">
            <select id="rp_year"></select>
            <select id="rp_month"></select>
            <input type="button" value="查询" onclick="findUserRP()">
            <table cellpadding="0" cellspacing="0" border="1px" id="user_rp_table"
                   style="background-color: rgba(0,130,230,0.6);">
                <thead>
                <tr>
                    <th colspan="4">奖惩信息</th>
                </tr>
                <tr>
                    <th style="padding: 1px 10px">奖惩原因</th>
                    <th style="padding: 1px 10px">奖惩时间</th>
                    <th style="padding: 1px 10px">奖惩金额</th>
                    <th style="padding: 1px 10px">奖/惩</th>
                </tr>
                </thead>
                <tbody>
                </tbody>
                <tfoot>
                <tr>
                    <td colspan="6" style="text-align: center;">
                        <input type="button" value="返回" id="user_rp_go_back">
                    </td>
                </tr>
                </tfoot>
            </table>
        </div>
    </div>

    <div id="user_position">
        <div id="sp_div0" style="margin: 30px 36%;">
            <ul class="ul1" id="first1">
                <h3 class="h3">部门职位列表</h3>
                <c:if test="${not empty sections}">
                    <c:forEach items="${sections}" var="se">
                        <hr class="hr"/>
                        <li class="li1" value="${se.id}">${se.section}</li>
                    </c:forEach>
                </c:if>
            </ul>

            <c:forEach items="${sections}" var="section" varStatus="st">
                <div class="details" style="top:${-45-27*(sections.size() - st.count)}px;">
                        <%--${sections.size()} ----- ${st.count}--%>
                    <ul class="ul2"></ul>
                </div>
            </c:forEach>
        </div>
    </div>

    <div id="user_salary">
        <div id="salary_div0" style="margin: 30px 30%;">
            <select id="salary_year"></select>
            <select id="salary_month"></select>
            <input type="button" value="查询" onclick="findUserSalary()">
            <table cellpadding="0" cellspacing="0" border="1px" id="user_salary_table"
                   style="background-color: rgba(0,130,230,0.6);">
                <thead>
                <tr>
                    <th colspan="7">我的工资</th>
                </tr>
                <tr>
                    <th style="padding: 1px 10px">最终实发</th>
                    <th style="padding: 1px 10px">基本工资</th>
                    <th style="padding: 1px 10px">绩效工资</th>
                    <th style="padding: 1px 10px">加班工资</th>
                    <th style="padding: 1px 10px">奖惩工资</th>
                    <th style="padding: 1px 10px">社保</th>
                    <th style="padding: 1px 10px">工资异议</th>
                </tr>
                </thead>
                <tbody>
                </tbody>
                <tfoot>
                <tr>
                    <td colspan="7" style="text-align: center;">
                        <input type="button" value="返回" id="user_salary_go_back">
                    </td>
                </tr>
                </tfoot>
            </table>
        </div>
    </div>

    <div id="user_dissent_background" class="background"></div>
    <div id="user_dissent" style="position: absolute;z-index: 1000;width: 100%;height: 100%; left: 0;">
        <fieldset id="fieldset_deal" style="height: 166px">
            <legend align="center">工资异议</legend>
            <form action="../dissent/addDissent" method="post" onsubmit="return checkDissentForm()" id="dissent_form">
                <div>
                    异议原因：<input type="text" name="dissent" id="deal" placeholder="请输入您的异议原因" style="margin-top: 25px"/>
                </div>
                <div class="error" id="name_error"></div>

                <input type="hidden" name="salarySheet.id" class="dissentId">

                <div style="margin-top: 20px">
                    <input type="submit" value="提交处理" id="submit1" class="sub" style="margin-left: 50px"/>
                    <input type="reset" value="取消" class="sub" id="dissent_deal_reset" onclick="dissentReset()"/>
                </div>
            </form>
        </fieldset>
    </div>

    <div id="user_others">
        <table cellpadding="0" cellspacing="0" border="1px" id="user_dissent_table"
               style="background-color: rgba(0,130,230,0.6); margin-top: 36px; margin-left:20%">
            <thead>
            <tr>
                <th colspan="7">异议消息</th>
            </tr>
            <tr>
                <th style="padding: 1px 10px">异议编号</th>
                <th style="padding: 1px 10px">工资编号</th>
                <th style="padding: 1px 10px">发放月份</th>
                <th style="padding: 1px 10px">异议内容</th>
                <th style="padding: 1px 10px">是否被查看</th>
                <th style="padding: 1px 10px">是否被处理</th>
                <th style="padding: 1px 10px">处理结果</th>
            </tr>
            </thead>
            <tbody>
            </tbody>
            <tfoot>
            <tr>
                <td colspan="7" style="text-align: center;">
                    <input type="button" value="返回" id="user_dissent_go_back">
                </td>
            </tr>
            </tfoot>
        </table>
    </div>
</div>

<div id="test"></div>

</body>
</html>
